package com.moyu.ui;

import com.moyu.activity.PanelGame;

import javax.swing.*;
import java.awt.*;

public class RightLayBottom extends Layout {
    PanelGame panelGame;
    public RightLayBottom(int x, int y, int w, int h,PanelGame panelGame) {
        super(x, y, w, h);
        this.panelGame = panelGame;
    }
    public void create(Graphics g){
        this.createWindow(g);
        //“得分”
        Image pointtext = new ImageIcon("resources/images/pointtext.png").getImage();
        g.drawImage(pointtext, 679, 568, 110, 80, null);
        //分数
        String[] thispoint = new String[3];
        thispoint[2] = Integer.toString(panelGame.getTotalpoint() % 10);
        thispoint[1] = Integer.toString((panelGame.getTotalpoint() / 10) % 10);
        thispoint[0] = Integer.toString((panelGame.getTotalpoint() / 100));
        for (int i = 0; i < 3; i++) {
            Image point = new ImageIcon("resources/images/point/" + thispoint[i] + ".png").getImage();
            g.drawImage(point, 770 + i * 32, 576, 40, 62, null);
        }
    }
}
